package com.mz.ozy.mvp.presenter;


import android.app.Activity;

import com.mz.ozy.base.BasePresenterImpl;
import com.mz.ozy.bean.InviteBean;
import com.mz.ozy.mvp.model.MyInviteModel;
import com.mz.ozy.mvp.view.MyInviteContract;
import com.mz.ozy.net.MyObserver;
import com.mz.ozy.utils.RxUtil;

import okhttp3.ResponseBody;

/**
 * Created by administrator on 2018/12/3.
 */
public class MyInvitePresenter extends BasePresenterImpl<MyInviteContract.View> implements MyInviteContract.Presenter {

    private MyInviteModel mModel;

    public MyInvitePresenter() {
        mModel = new MyInviteModel();
    }


    @Override
    public void getCommunityLevelList(Activity activity, String pageNo) {
        mModel.getCommunityLevelList(activity, pageNo)
                .compose(RxUtil.rxSchedulerHelper(mView.<ResponseBody>bindToLifecycle()))
                .subscribe(new MyObserver<InviteBean>(mView) {
                    @Override
                    public void onSuccesss(InviteBean json) {
                        mView.getCommunityLevelListSuccess(json);
                    }
                });
    }
}
